<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>编辑平仓 - Powered By Betou</title>
<meta name="author" content="Betou Team" />
<meta name="copyright" content="Betou" />
<#include "../../head.html"/>
<script type="text/javascript" src="${base}/thirdparty/datepicker/WdatePicker.js"></script>
<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	// 表单验证
	$inputForm.validate({
		rules: {
			openPosition: {
				required: true,
				min: 0,
				decimal: {
					integer: 12,
					fraction: 2
				}
			},
			stopPosition: {
				required: true,
				min: 0,
				decimal: {
					integer: 12,
					fraction: 2
				}
			},
			longPosition: {
				required: true,
				min: 0,
				decimal: {
					integer: 12,
					fraction: 2
				}
			},
			closePosition: {
				required: true,
				min: 0,
				decimal: {
					integer: 12,
					fraction: 2
				}
			},
			startDate:"required",
			endDate:"required",
			closeReason:{maxlength:1000}
		}
	});

	loadSmsNumAndUseNum("send", "smsGroup");
	$("#inputForm input[name*=smsGroup]").click(function(){
		loadSmsNumAndUseNum("send", "smsGroup");
	})
});
</script>
</head>
<body class="content">
	<div class="path">
		<a href="../index.jspx">首页</a> &raquo; 编辑平仓
	</div>
	<form id="inputForm" action="o_update.jspx" method="post"  >
		<input type="hidden" name="id" value="${bean.id!}"/>
		<table class="input tabContent">
			<tr>
				<th>面向用户:</th>
				<td>
					<#list groupList as g ><#list bean.groups as gg><#if g.id == gg>[${g.name!}]&nbsp;</#if></#list></#list>
				</td>
			</tr>
			<#if bean.smsGroup??>
			<tr>
				<th>短信发送：</th>
				<td>
					<#list groupList as g>
						<#list bean.smsGroup as gg><#if g.id == gg><label><input type="checkbox" name="smsGroup" value="${g.id!}" checked/>${g.name!}</label></#if></#list>
					</#list>
				</td>
			</tr>
			<tr>
				<th>设置:</th>
				<td>
					<span class="fieldSet"> 
						<label><input type="checkbox" name="send" value="true" checked/>立即发送短信</label>
						&nbsp;<span id="loading" class="green">正在加载短信信息...</span>
					</span>
				</td>
			</tr>
			</#if>
			<tr>
				<th>喊单品种:</th>
				<td>${bean.category.name!}</td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>平仓方向:</th>
				<td>
					<select name="direction">
						<option value="1" <#if bean.direction> selected</#if> >空单</option>
						<option value="0" <#if !bean.direction> selected</#if> >多单</option>
					</select>
				</td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>开仓点位:</th>
				<td>
					<input type="text" name="openPosition" class="text"  value="${bean.openPosition!}" />
				</td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>止损点位:</th>
				<td>
					<input type="text" name="stopPosition" class="text"  value="${bean.stopPosition!}"  />
				</td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>止盈点位:</th>
				<td>
					<input type="text" name="longPosition" class="text"  value="${bean.longPosition!}" />
				</td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>平仓点位:</th>
				<td>
					<input type="text" name="closePosition" class="text"  value="${bean.closePosition!}" />
				</td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>开仓时间:</th>
				<td>
					<input type="text" name="startDate" class="text Wdate"  readonly="readonly" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm:ss'})"  maxlength="100"  value="${bean.startDate?string('yyyy-MM-dd hh:mm:ss')}"/>
				</td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>平仓时间:</th>
				<td>
					<input type="text" name="endDate" class="text Wdate" readonly="readonly"  onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm:ss'})"  maxlength="100"  value="${bean.endDate?string('yyyy-MM-dd hh:mm:ss')}"/>
				</td>
			</tr>
			<tr>
				<th>平仓理由:</th>
				<td>
						<textarea name="closeReason" class="text">${bean.closeReason!}</textarea>
				</td>
			</tr>
		</table>
		
		<table class="input">
			<tr>
				<th>&nbsp;</th>
				<td>
					<input type="submit" class="button" value="确&nbsp;&nbsp;定" />
					<input type="button" class="button" value="返&nbsp;&nbsp;回" onclick="location.href='v_list.jspx'" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
